package com.sqx.modules.task.service.impl;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.sqx.common.utils.DateUtils;
import com.sqx.common.utils.PageUtils;
import com.sqx.common.utils.Result;
import com.sqx.modules.app.entity.UserEntity;
import com.sqx.modules.app.entity.UserMoney;
import com.sqx.modules.app.entity.UserMoneyDetails;
import com.sqx.modules.app.service.UserMoneyDetailsService;
import com.sqx.modules.app.service.UserMoneyService;
import com.sqx.modules.app.service.UserService;
import com.sqx.modules.bidding.entity.HelpBidding;
import com.sqx.modules.bidding.service.HelpBiddingService;
import com.sqx.modules.common.entity.CommonInfo;
import com.sqx.modules.common.service.CommonInfoService;
import com.sqx.modules.fixedClassify.entity.FixedClassify;
import com.sqx.modules.fixedClassify.service.FixedClassifyService;
import com.sqx.modules.message.entity.MessageInfo;
import com.sqx.modules.message.service.MessageService;
import com.sqx.modules.pay.controller.app.AliPayController;
import com.sqx.modules.pay.service.WxService;
import com.sqx.modules.taking.entity.Game;
import com.sqx.modules.taking.service.GameService;
import com.sqx.modules.task.dao.HelpOrderDao;
import com.sqx.modules.task.dao.HelpTakeDao;
import com.sqx.modules.task.dao.MasterServiceDao;
import com.sqx.modules.task.entity.HelpOrder;
import com.sqx.modules.task.entity.HelpTake;
import com.sqx.modules.task.entity.MasterService;
import com.sqx.modules.task.service.HelpTakeService;
import com.sqx.modules.task.service.MasterServiceService;
import com.sqx.modules.utils.SenInfoCheckUtil;
import com.sqx.modules.utils.excel.ExcelData;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang.StringUtils;
import org.apache.commons.lang.time.DateFormatUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.math.BigDecimal;
import java.text.SimpleDateFormat;
import java.util.*;
import java.util.concurrent.locks.ReentrantReadWriteLock;

/**
 * 师傅关联订单
 *
 * @author fang
 * @date 2023/08/02
 */
@Slf4j
@Service
public class MasterServiceServiceImpl extends ServiceImpl<MasterServiceDao, MasterService> implements MasterServiceService {


    @Override
    public Result updateMasterService(String classifyIds,Long userId){
        baseMapper.delete(new QueryWrapper<MasterService>().eq("user_id",userId));
        for (String classifyId:classifyIds.split(",")){
            MasterService masterService=new MasterService();
            masterService.setMasterUserId(userId);
            masterService.setClassifyId(Long.parseLong(classifyId));
            baseMapper.insert(masterService);
        }
        return Result.success();
    }





}
